Remove Shutdown Hooks and Dump Admin State on Startup - #474
Merged
Conversation
Signed-off-by: Adrian Cole <adrian@tetrate.io>
|
|
||
| func init() { | ||
| // Don't let urfave quit the current test process on cancel! | ||
| cli.OsExiter = func(code int) { log.Printf("urfave called exit: %d", code) } |
Contributor
Author
There was a problem hiding this comment.
I'm sure @mathetake and @anuraaga could guess the rage level when I finally figured out what was quitting the whole test process.
codefromthecrypt
marked this pull request as draft
July 20, 2025 14:06
Contributor
Author
|
there's a race between admin hook finishing and envoy being canceled. I have work in progress and will push tomorrow |
Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
force-pushed
the
no_shutdown
branch
from
July 21, 2025 03:54
6ce7499 to
a9919f1
Compare
codefromthecrypt
marked this pull request as ready for review
July 21, 2025 03:59
Contributor
Author
|
ps after this change I will look into allowing the user to supply their own StartupHook or ability to remove the default one. |
mathetake
approved these changes
Jul 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This simplifies func-e's lifecycle by removing shutdown hooks and collecting admin state on startup instead. Essential xDS configuration data is captured when Envoy's dispatch loop starts, making it available immediately when needed. This makes things more coherent and allows us to leverage
CommandContextfor signal propagation.This also aligns exit behavior with native Envoy (code 0 on graceful shutdown/interrupt). This allows
api.Runto return nil on effective success (context canceled or exit code zero), increasing the signal of the error return.Impact
Runreturns nil on interrupts (vs. prior errors).Key Changes
The key improvement is that essential xDS data is now captured reliably during startup when Envoy's admin API becomes available, rather than attempting complex shutdown coordination. This provides the necessary configuration visibility with significantly less complexity and better cross-platform reliability
stdout.log,stderr.log,envoy.pid,config_dump.jsonwith full xDS snapshot. No archiving.TestRun_MinimalListenertoTestRun_RunDirectory.golang.org/x/sync; update docs/help (no hooks/archiving mentions).